import { configure, makeAutoObservable } from 'mobx';
import type ILoading from '../types/loading';

configure({
    enforceActions: 'always'
});
class Stroe {
    isShowLoading = false;
    loadingText = "加载中";
    loadingColor = "#cbb486";
    showLoading(param?: ILoading) {
        this.isShowLoading = true;
        this.loadingText = param?.text || this.loadingText;
        this.loadingColor = param?.color || this.loadingColor;
    };
    hideLoading() {
        this.isShowLoading = false;
    };
    constructor() {
        makeAutoObservable(this)
    }
}
const store = new Stroe();
export default store;